package com.itheima.controller;

import com.itheima.pojo.Account;
import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class AccountController {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");

        //com.sun.proxy.Proxy$0,这里不能用实现类接,因为加了事务,注解底层是aop,aop默认jdk代理
        //要用类接,必须在spring.xml中的开启事务支持,proxy-target-class="false"改为true,就改为cglib代理了
        AccountService accountService = ac.getBean(AccountService.class);

        List<Account> all = accountService.findAll();
        System.out.println(all);
        //accountService.transfer(1,2,10D);
    }
}
